package com.wanxi.web.controller;

import com.wanxi.enterprise.api.dto.EnterpriseUpdateInDTO;
import com.wanxi.enterprise.api.query.EnterpriseQuery;
import com.wanxi.enterprise.api.result.CommonResult;
import com.wanxi.enterprise.api.vo.EnterpriseAddInVo;
import com.wanxi.enterprise.api.vo.LocateApplyAddInVo;
import com.wanxi.web.service.enterprise.EnterpriseWebService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@Api(tags = "商家自我管理")
public class EnterpriseSelfController {
    @Resource
    private EnterpriseWebService enterpriseService;

    /**
     * @author jinfang
     * @description // 商家完善自己的商家信息（从游客角色转换为商家）
     * @date  2022/1/18
     * @params enterpriseAddInVo
     * @return CommonResult
     **/
    @PostMapping("enterprise/addEnterprise")
    public CommonResult addEnterprise(EnterpriseAddInVo enterpriseAddInVo){
        return enterpriseService.addEnterprise(enterpriseAddInVo);
    }

    /**
     * @Author jinfang
     * @Description // 商家查看自己的入驻信息
     * @Date  2022/1/13
     * @Params id
     * @return CommonResult
     **/
    @GetMapping("enterprise/findApplyDataById")
    public CommonResult findApplyDataById(Long id){
        return enterpriseService.findApplyDataById(id);
    }

    /**
     * @Author jinfang
     * @Description // 商家申请入驻，输入入驻资料，添加商家资料到入驻申请表
     * @Date  2022/1/6
     * @Params locateApplyAddInVo
     * @return CommonResult
     **/
    @PostMapping("enterprise/addApply")
    public CommonResult addApply(LocateApplyAddInVo locateApplyAddInVo){
        return enterpriseService.addApply(locateApplyAddInVo);
    }
}
